{include file="top.html"}
<link rel="stylesheet" href="{$CSS_PATH}order.css"/>
<!--detail Start-->
<div class="wrapper clearfix">
  <div class="container">
    <div class="center">
        <!--左侧导航栏-->
        {include file="user_left.html"}
        <div class="sidebar_r">
            <div class="box-hd">
                <h1 class="title">我的订单</h1>
            </div>
            <div class="order-list-box">
                <div class="order-tad">
                    <script>
                        $(function(){
                            var status='{$smarty.get.pay_status}';
                            $(".filter-list li" ).each(function(){
                                if($(this ).attr('data-status')==status){
                                    $(".filter-list li" ).removeClass('active');
                                    $(this ).addClass('active');
                                }
                            })
                        })
                    </script>
                    <ul class="filter-list"> 
                        <li class="first active"><a href="user.php">所有({$all_orders_count})</a></li>
                        <li data-status="2"><a href="user.php?pay_status=2">已完成({$finished_orders_count})</a></li>
                        <li data-status="0,1"><a href="user.php?pay_status=0,1">待付款({$payed_orders_count})  </a></li>
                    </ul>
                </div>
                <div class="order-box-bd">
                    {if count($orders) eq ''}
                    <!-- 为空 -->
                    <div class="order-list">
                        <p class="empty">当前没有交易订单。</p>
                    </div>
                    {else}

                    <ul class="order-list">
                    <!--等待付款  order-item-pay-->
                        {foreach from=$orders item=order key=key_id}
                        {if $order.pay_status eq 0 or $order.pay_status eq 1}
                        <li class="order-item order-item-pay">
                            <div class="order-detail">
                                <div class="order-summary">
                                     <div class="order-status">等待付款</div>    
                                </div>
                                <table class="order-detail-table"> 
                                    <thead> 
                                        <tr>
                                            <th class="col-main"> 
                                                <p class="caption-info">订单号： <a href="javascript:;">{$order.order_sn} </a><span class="sep">|</span>下单时间：{$order.add_time}
                                                </p> 
                                                </th> 
                                            <th class="col-sub">
                                                 <p class="caption-price">订单金额：<span class="num">{$order.order_amount}</span></p>
                                             </th> 
                                        </tr> 

                                    </thead> 
                                    <tbody> 
                                        <tr> 
                                            <td class="order-items"> 
                                                <ul class="goods-list"> 
                                                    <li> 
                                                        <div class="figure figure-thumb">   
                                                        <a href="javascript:;" target="_blank"> <img src="{$order.goods_thumb}" width="" height="" alt=""> </a>
                                                         </div>
                                                         <p class="name"> <a target="_blank" href="javascript:;">{$order.goods_name}</a>  </p>
                                                         <p class="desc">
                                                             {foreach from=$order.goods_attr item=attr_val key=attr_key}
                                                             <span>{$attr_key}<em>{$attr_val} </em></span>
                                                             {/foreach}
                                                        </p> 
                                                     </li>  
                                                 </ul>
                                                </td> 
                                            <td class="order-actions">    
                                                 <a class="btn  btn-primary" href="user.php?act=to_pay&order_id={$order.order_id}">立即支付</a>
                                                   <a href="user.php?act=order_detail&order_id={$order.order_id}" class="btn">订单详情</a>
                                            </td> 
                                        </tr> 
                                    </tbody>
                                </table>
                            </div>
                        </li>
                        {elseif $order.pay_status eq 2}
                        <!--已完成-->
                        <li class="order-item ">
                            <div class="order-detail">
                                <div class="order-summary">
                                    <div class="order-status">已完成</div>
                                </div>
                                <table class="order-detail-table">
                                    <thead>
                                    <tr>
                                        <th class="col-main">
                                            <p class="caption-info">订单号： <a href="javascript:;">{$order.order_sn} </a><span class="sep">|</span>下单时间：{$order.add_time}
                                            </p>
                                        </th>
                                        <th class="col-sub">
                                            <p class="caption-price">订单金额：<span class="num">{$order.order_amount}</span></p>
                                        </th>
                                    </tr>

                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td class="order-items">
                                            <ul class="goods-list">
                                                <li>
                                                    <div class="figure figure-thumb">
                                                        <a href="javascript:;" target="_blank"> <img src="{$order.goods_thumb}" width="" height="" alt=""> </a>
                                                    </div>
                                                    <p class="name"> <a target="_blank" href="javascript:;">{$order.goods_name}</a>  </p>
                                                    <p class="desc">
                                                        {foreach from=$order.goods_attr item=attr_val key=attr_key}
                                                        <span>{$attr_key}<em>{$attr_val} </em></span>
                                                        {/foreach}
                                                    </p>
                                                </li>
                                            </ul>
                                        </td>
                                        <td class="order-actions">

                                            <a class="btn" href="user.php?act=order_detail&order_id={$order.order_id}">订单详情</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </li>
                        {elseif $order.order_status eq 3}
                        <li class="order-item ">
                            <div class="order-detail">
                                <div class="order-summary">
                                    <div class="order-status">订单处理中</div>
                                </div>
                                <table class="order-detail-table">
                                    <thead>
                                    <tr>
                                        <th class="col-main">
                                            <p class="caption-info">订单号： <a href="javascript:;">{$order.order_sn} </a><span class="sep">|</span>下单时间：{$order.add_time}
                                            </p>
                                        </th>
                                        <th class="col-sub">
                                            <p class="caption-price">订单金额：<span class="num">1168.00</span></p>
                                        </th>
                                    </tr>

                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td class="order-items">
                                            <ul class="goods-list">
                                                <li>
                                                    <div class="figure figure-thumb">
                                                        <a href="javascript:;" target="_blank"> <img src="{$order.goods_thumb}" width="" height="" alt=""> </a>
                                                    </div>
                                                    <p class="name"> <a target="_blank" href="javascript:;">{$order.goods_name}</a>  </p>
                                                    <p class="desc">
                                                        {foreach from=$order.goods_attr item=attr_val key=attr_key}
                                                        <span>{$attr_key}<em>{$attr_val} </em></span>
                                                        {/foreach}
                                                    </p>
                                                </li>
                                            </ul>
                                        </td>
                                        <td class="order-actions">

                                            <a class="btn" href="user.php?act=order_detail&order_id={$order.order_id}">订单详情</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </li>
                        {/if}
                        {/foreach}

                    </ul>
                    {/if}
                </div>

            </div>
        </div>
    </div>
  </div>

</div>

{include file="foot.html"}
</body>
</html>